package com.wenson.structural.composite;

/**
 * @ClassName: CompositeClient
 * @Author: luowangcheng
 * @Date: 2024/6/13 22:49
 * @Description:
 */
public class CompositeClient {
    public static void main(String[] args) {
        Node driverD = new Folder("D盘");
        Node doc = new Folder("文档");
        doc.add(new File("简历.doc"));
        doc.add(new File("项目介绍.ppt"));
        driverD.add(doc);

        Node music = new Folder("音乐");

        Node jay = new Folder("周杰伦");
        jay.add(new File("双节棍.mp3"));
        jay.add(new File("双节棍.mp3"));
        jay.add(new File("双节棍.mp3"));
        music.add(jay);

        Node jack = new Folder("张学友");
        jack.add(new File("吻别.mp3"));
        jack.add(new File("一千个伤心的理由.mp3"));
        music.add(jack);

        driverD.add(music);
        driverD.tree();
    }
}
